<div class="wrapper wrapper-content" ng-controller="CommandMasterController">
	<div class="row">
		<div class="col-lg-12">
			<div class="tabs-container">

				<uib-tabset>
					<uib-tab heading="{{'SETTING.COMMAND' | translate}}">
						<div class="panel-body" ng-controller="CommandController">
							<div class="col-md-3">
								<a ng-click="addCommand()" class="btn btn-primary btn-rounded  btn-outline" href="">
									<i class="fa fa-plus-circle"></i> {{'SETTING.ADD_COMMAND' | translate}}
								</a>
								<a ng-click="importCommand()" class="btn btn-primary btn-rounded  btn-outline" href="">
									<i class="fa fa-plus-circle"></i> {{'SETTING.IMPORT' | translate}}
								</a>
							</div>
							<div class="col-md-9">
								<input type="text" class="form-control m-b-xs"
									   placeholder="{{'SETTING.SEARCH' | translate}}"
									   ng-model="searchKeyword"
									   ng-keyup="searchCommands()">
							</div>
							<table class="footable table table-bordered table-hover" data-sort="true" data-page-size="15">
								<thead>
									<tr>
										<th class="text-center" data-type="numeric">{{'SETTING.ID' | translate}}</th>
										<th class="text-center">{{'SETTING.NAME' | translate}}</th>
										<th class="text-center">{{'COMMAND.TOPIC' | translate}}</th>
										<th class="text-center">{{'COMMAND.PAYLOAD' | translate}}</th>
										<th class="text-center">{{'COMMAND.SET_VALUE' | translate}}</th>
										<th class="text-center">{{'SETTING.DESCRIPTION' | translate}}</th>
										<th class="text-center">{{'SETTING.ACTION' | translate}}</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="command in commands">
										<td class="text-center">{{ command.id }}</td>
										<td class="text-center">{{ command.name }}</td>
										<td class="text-center">{{ command.topic }}</td>
										<td class="text-center">{{ command.payload }}</td>
										<td class="text-center">{{ command.set_value }}</td>
										<td class="text-center">{{ command.description }}</td>
										<td class="text-center">
											<a ng-click="editCommand(command)"
												class="btn btn-primary btn-rounded btn-xs">{{'SETTING.EDIT' | translate}}</a>
											<a ng-click="deleteCommand(command)"
												class="btn btn-danger btn-rounded btn-xs">{{'SETTING.DELETE' | translate}}</a>
											<a ng-click="sendCommand(command)"
												class="btn btn-danger btn-rounded btn-xs">{{'COMMAND.SEND' | translate}}</a>
											<a ng-click="exportCommand(command)" class="btn btn-danger btn-rounded btn-xs" >{{'SETTING.EXPORT' | translate}}</a>
											<a ng-click="cloneCommand(command)" class="btn btn-danger btn-rounded btn-xs" >{{'SETTING.CLONE' | translate}}</a>
										</td>
									</tr>
								</tbody>
								<tfoot class="hide-if-no-paging">
									<tr>
										<td colspan="6">
											<ul class="pagination pull-right"></ul>
										</td>
									</tr>
								</tfoot>
							</table>
						</div>
					</uib-tab>
				</uib-tabset>
			</div>
		</div>
	</div>
</div>